/*
 * Copyright (C) 2009, 2014 Apple Inc. All Rights Reserved.
 * Copyright (C) 2009 Brent Fulgham. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

#ifndef PrintWebUIDelegate_h
#define PrintWebUIDelegate_h

#include "WebKit.h"

class CWebkitView;
class PrintWebUIDelegate : public IWebUIDelegate, public IWebUIDelegatePrivate {
public:
	PrintWebUIDelegate(CWebkitView* owner) : m_refCount(0), m_owner(owner) {}

    // IUnknown
    HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) override;
    ULONG STDMETHODCALLTYPE AddRef(void) override;
    ULONG STDMETHODCALLTYPE Release(void) override;

	//IWebUIDelegate
    HRESULT STDMETHODCALLTYPE createWebViewWithRequest(IWebView*, IWebURLRequest*, IWebView**) override;
    HRESULT STDMETHODCALLTYPE webViewShow(IWebView*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewClose(IWebView*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewFocus(IWebView*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewUnfocus(IWebView*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewFirstResponder(IWebView*, HWND*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE makeFirstResponder(IWebView*, HWND) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setStatusText(IWebView*, BSTR) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewStatusText(IWebView*, BSTR*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewAreToolbarsVisible(IWebView*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setToolbarsVisible(IWebView*, BOOL) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewIsStatusBarVisible(IWebView*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setStatusBarVisible(IWebView*, BOOL) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewIsResizable(IWebView*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setResizable(IWebView*, BOOL) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setFrame(IWebView*, RECT*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewFrame(IWebView*, RECT*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setContentRect(IWebView*, RECT*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewContentRect(IWebView*, RECT*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE runJavaScriptAlertPanelWithMessage(IWebView*, BSTR) override;
    HRESULT STDMETHODCALLTYPE runJavaScriptConfirmPanelWithMessage(IWebView*, BSTR, BOOL*) override;
    HRESULT STDMETHODCALLTYPE runJavaScriptTextInputPanelWithPrompt(IWebView*, BSTR, BSTR, BSTR*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE runBeforeUnloadConfirmPanelWithMessage(IWebView*, BSTR, IWebFrame*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE runOpenPanelForFileButtonWithResultListener(IWebView*, IWebOpenPanelResultListener*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE mouseDidMoveOverElement(IWebView*, IPropertyBag*, UINT) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE contextMenuItemsForElement(IWebView*, IPropertyBag*, HMENU, HMENU*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE validateUserInterfaceItem(IWebView*, UINT, BOOL, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE shouldPerformAction(IWebView*, UINT, UINT) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE dragDestinationActionMaskForDraggingInfo(IWebView*, IDataObject*, WebDragDestinationAction*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE willPerformDragDestinationAction(IWebView*, WebDragDestinationAction, IDataObject*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE dragSourceActionMaskForPoint(IWebView*, LPPOINT, WebDragSourceAction*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE willPerformDragSourceAction(IWebView*, WebDragSourceAction, LPPOINT, IDataObject*, IDataObject**) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE contextMenuItemSelected(IWebView*, void*, IPropertyBag*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE hasCustomMenuImplementation(BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE trackCustomPopupMenu(IWebView*, HMENU, LPPOINT) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE measureCustomMenuItem(IWebView*, void*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE drawCustomMenuItem(IWebView*, void*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE addCustomMenuDrawingData(IWebView*, HMENU) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE cleanUpCustomMenuDrawingData(IWebView*, HMENU) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE canTakeFocus(IWebView*, BOOL, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE takeFocus(IWebView*, BOOL) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE registerUndoWithTarget(IWebUndoTarget*, BSTR, IUnknown*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE removeAllActionsWithTarget(IWebUndoTarget*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setActionTitle(BSTR) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE undo() override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE redo() override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE canUndo(BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE canRedo(BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE printFrame(IWebView*, IWebFrame *) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE ftpDirectoryTemplatePath(IWebView*, BSTR*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE webViewHeaderHeight(IWebView*, float*) override;
    HRESULT STDMETHODCALLTYPE webViewFooterHeight(IWebView*, float*) override;
    HRESULT STDMETHODCALLTYPE drawHeaderInRect(IWebView*, RECT*, ULONG_PTR) override;
    HRESULT STDMETHODCALLTYPE drawFooterInRect(IWebView*, RECT*, ULONG_PTR, UINT, UINT) override;
    HRESULT STDMETHODCALLTYPE webViewPrintingMarginRect(IWebView*, RECT*) override;
    HRESULT STDMETHODCALLTYPE canRunModal(IWebView*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE createModalDialog(IWebView*, IWebURLRequest*, IWebView**) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE runModal(IWebView*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE isMenuBarVisible(IWebView*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE setMenuBarVisible(IWebView*, BOOL) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE runDatabaseSizeLimitPrompt(IWebView*, BSTR, IWebFrame*, BOOL*) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE paintCustomScrollbar(IWebView*, HDC, RECT, WebScrollBarControlSize, WebScrollbarControlState, WebScrollbarControlPart, BOOL, float, float, WebScrollbarControlPartMask) override { return E_NOTIMPL; }
    HRESULT STDMETHODCALLTYPE paintCustomScrollCorner(IWebView*, HDC, RECT) override { return E_NOTIMPL; }

	//IWebUIDelegatePrivate
	HRESULT STDMETHODCALLTYPE unused1(void) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE unused2(void) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewScrolled(IWebView *sender) override;
	HRESULT STDMETHODCALLTYPE webViewAddMessageToConsole(IWebView *sender, BSTR message, int lineNumber,
		BSTR url, BOOL isError) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewShouldInterruptJavaScript(IWebView *sender, BOOL *result) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewReceivedFocus(IWebView *sender) override;
	HRESULT STDMETHODCALLTYPE webViewLostFocus(IWebView *sender, HWND loseFocusToHWnd) override;
	HRESULT STDMETHODCALLTYPE doDragDrop(IWebView *sender, IDataObject *dataObject, IDropSource *dropSource,
		DWORD okEffect, DWORD *performedEffect) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewGetDlgCode(IWebView *sender, UINT keyCode, LONG_PTR *code) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewPainted(IWebView *sender) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE exceededDatabaseQuota(IWebView *sender, IWebFrame *frame,
		IWebSecurityOrigin *origin, BSTR databaseIdentifier) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE embeddedViewWithArguments(IWebView *sender, IWebFrame *frame,
		IPropertyBag *arguments, IWebEmbeddedView **view) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE unused3(void) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewClosing(IWebView *sender) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewSetCursor(IWebView *sender, HCURSOR cursor) override { return E_NOTIMPL; }
	HRESULT STDMETHODCALLTYPE webViewDidInvalidate(IWebView *sender) override { return E_NOTIMPL; }

protected:
	CWebkitView* m_owner;

private:
    intptr_t m_refCount;
};

#endif
